package com.medi.business.service.impl;

import java.util.List;
import com.medi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.medi.business.mapper.OrgInfoMapper;
import com.medi.business.domain.OrgInfo;
import com.medi.business.service.IOrgInfoService;

/**
 * 组织机构Service业务层处理
 * 
 * @author medi
 * @date 2024-09-13
 */
@Service
public class OrgInfoServiceImpl implements IOrgInfoService 
{
    @Autowired
    private OrgInfoMapper orgInfoMapper;

    /**
     * 查询组织机构
     * 
     * @param orgId 组织机构主键
     * @return 组织机构
     */
    @Override
    public OrgInfo selectOrgInfoByOrgId(String orgId)
    {
        return orgInfoMapper.selectOrgInfoByOrgId(orgId);
    }

    /**
     * 查询组织机构列表
     * 
     * @param orgInfo 组织机构
     * @return 组织机构
     */
    @Override
    public List<OrgInfo> selectOrgInfoList(OrgInfo orgInfo)
    {
        return orgInfoMapper.selectOrgInfoList(orgInfo);
    }

    /**
     * 新增组织机构
     * 
     * @param orgInfo 组织机构
     * @return 结果
     */
    @Override
    public int insertOrgInfo(OrgInfo orgInfo)
    {
        orgInfo.setCreateTime(DateUtils.getNowDate());
        return orgInfoMapper.insertOrgInfo(orgInfo);
    }

    /**
     * 修改组织机构
     * 
     * @param orgInfo 组织机构
     * @return 结果
     */
    @Override
    public int updateOrgInfo(OrgInfo orgInfo)
    {
        orgInfo.setUpdateTime(DateUtils.getNowDate());
        return orgInfoMapper.updateOrgInfo(orgInfo);
    }

    /**
     * 批量删除组织机构
     * 
     * @param orgIds 需要删除的组织机构主键
     * @return 结果
     */
    @Override
    public int deleteOrgInfoByOrgIds(String[] orgIds)
    {
        return orgInfoMapper.deleteOrgInfoByOrgIds(orgIds);
    }

    /**
     * 删除组织机构信息
     * 
     * @param orgId 组织机构主键
     * @return 结果
     */
    @Override
    public int deleteOrgInfoByOrgId(String orgId)
    {
        return orgInfoMapper.deleteOrgInfoByOrgId(orgId);
    }
}
